Weighted Random Selection With Godot
Weighted Random Selection With Godot
When working in a game we frequently want to randomly select something, be it to generate loot or maybe pick a random tile to generate levels. In this tutorial I show a method to randomly select something from a list but taking weights (different probabilities) into account. First I go over a tiny bit of theory then show the implementation in Godot using GDScript. After that I present some tips on how to use this technique on a few possible different use cases.
Godot Engineの GDScript で重み付けランダム処理の解説
2020年の記事なので、Godot 3.xベース